package com.guigarage.gestures;

import java.util.EventObject;

import javax.swing.JComponent;

/**
 * Basic event for all gesture events
 * 
 * @author hendrikebbers
 * @see GestureMagnificationEvent
 * @see GesturePhaseEvent
 * @see GestureRotationEvent
 * @see GestureSwipeEvent
 */
public class GestureEvent extends EventObject {

	private static final long serialVersionUID = 1L;

	private boolean consumed = false;

	/**
	 * Constructs a <code>GestureEvent</code> object with the
     * specified source component
	 * @param source the component on with the event occured
	 */
	protected GestureEvent(JComponent source) {
		super(source);
	}

	/**
	 * consume this event
	 */
	public void consume() {
		consumed = true;
	}

	/**
	 * @return true if this event has been consumed
	 */
	public boolean isConsumed() {
		return consumed;
	}

}
